home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++ / leda / 46 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: kalypso.cybercom.net!not-for-mail
  2. From: stok@kalypso.cybercom.net (Michael J. Stok)
  3. Newsgroups: comp.lang.smalltalk,comp.lang.perl.misc,comp.lang.pascal.borland,comp.lang.eiffel,comp.lang.cobol,comp.lang.c++.leda,comp.lang.c,comp.lang.basic.visual.3rdparty,alt.computer.workshop.live
  4. Subject: Re: PROGRAMERS OF ANY LANGUAGE
  5. Date: 10 Apr 1996 07:15:24 -0400
  6. Organization: Pencom Systems Administration
  7. Message-ID: <4kg58c$djh@kalypso.cybercom.net>
  8. References: <Pine.SOL.3.91.960329010021.13209A-100000@harvey> <4k4pl2$pea@host1.einstein.com.ar> <316A6189.4287@wight.hursley.ibm.com>
  9. Reply-To: stok@cybercom.net
  10. NNTP-Posting-Host: kalypso.cybercom.net
  11.  
  12. In article <316A6189.4287@wight.hursley.ibm.com>,
  13. Max Waterman  <max@lton.u-net.com> wrote:
  14.  
  15. >Why use {/} ? Why not just get the compiler to recognise the indentation?
  16. >Does anyone out there not indent and extra width for a block? It's rare to
  17. >get the indentation wrong but it's common to forget to put the {/}s in -
  18. >especially when changing code.
  19. >
  20. >Any comments?
  21.  
  22. The {}s shouldn't be optional!  That's the route Perl took with blocks 
  23. after for, if, while, else etc.  Just because C and similar languages 
  24. have the "optimisation" that they the {}s are optional doesn't mean it's 
  25. right :-)
  26.  
  27. I would not like to be forced to use a particular indentation to indicate 
  28. blocks, some people like 2 spaces, others 4, others use tab characters 
  29. which depend on the setup of your editor.  Python and Occam spring to 
  30. mind as languages which used indentation to indicate block structure and 
  31. it seems to work OK even if it flies in the face of letting the author 
  32. have some control over the layout of his code.
  33.  
  34. There are code beautifiers which can re-indent code and highlight this 
  35. kind of error for most programming languages which were designed to make 
  36. life easier for the compiler writer rather than the person using the 
  37. language...
  38.  
  39. Mike
  40.  
  41. -- 
  42. Mike Stok                        | The "`Stok' disclaimers" apply.
  43. stok@pencom.com                  | Pencom Systems Administration (work)
  44. stok@cybercom.net                | Cyber Access (play)
  45. http://www.cybercom.net/~stok/   | The inevitable WWW page (?)
  46.